﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pollogger.Library
{
	[Serializable]
	public class Logger
	{
		private string _name;
		private List<LogWriter> _writers = null;
		private LogConfig _parentConfig = null;


		public Logger(LogConfig parentConfig)
		{
			_parentConfig = parentConfig;
		}

		public string Name
		{
			get
			{
				return _name;
			}
			set
			{
				_name = value;
			}
		}

		public List<LogWriter> Writers
		{
			get 
			{
				if (_writers == null)
				{
					LoadWriters();
				}
				return _writers; 
			}
			set
			{
				_writers = value;
			}
		}

		private void LoadWriters()
		{
			_writers = new List<LogWriter>();
		}

		public LogConfig ParentConfig
		{
			get { return _parentConfig; }
			set { _parentConfig = value; }
		}
	}
}
